package com.sanil.sample.ddb.service.impl;

import com.sanil.sample.ddb.mapper.DbInfoMapper;
import com.sanil.sample.ddb.service.IDbInfoService;
import com.snail.common.dyd.DataBaseOperator;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DbInfoServiceImpl implements IDbInfoService {

    private DbInfoMapper dbInfoMapper;
    @Override
    public List<String> getAllDbName(String dsName) {
        List<String> dbNameList = dbInfoMapper.queryAllDbName(dsName);
        return dbNameList;
    }

    @Override
    public void setDataBaseOperator(DataBaseOperator dataBaseOperator) {
        if(dataBaseOperator instanceof DbInfoMapper){
            this.dbInfoMapper = (DbInfoMapper) dataBaseOperator;
        }
    }
}
